package com.txzt.gaea.common.enums;

public enum BorrowStatus {

    /**
     * 待提交
     */
    INIT(0,"待提交"),
    /**
     * 审核中
     */
    CHECK(1,"审核中"),
    /**
     * 审核通过
     */
    PASS(2,"审核通过"),
    /**
     * 退回修改
     */
    BACK(98,"退回修改"),
    /**
     * 审核不通过
     */
    REJECT(99,"审核不通过"),
    ;

    private final Integer code;

    private final String info;

    BorrowStatus(Integer code, String info) {
        this.code = code;
        this.info = info;
    }

    public Integer getCode() {
        return code;
    }

    public String getInfo() {
        return info;
    }

    public static String getInfoByCode(Integer code){
        BorrowStatus[] statuses = values();
        for (BorrowStatus status:statuses){
            if (status.getCode().equals(code)) {
                return status.getInfo();
            }
        }
        return "";
    }
}
